package everyday;

import java.util.HashSet;
import java.util.Set;

public class T2441 {
    public int findMaxK(int[] nums) {
        Set<Integer> set = new HashSet<>();
        int MaxK = -1;
        for (int num : nums) {
            if (set.contains(num)) {
                MaxK = Math.max(MaxK, Math.abs(num));
            }
            set.add(-1 * num);
        }
        return MaxK;
    }
}
